﻿using Api.DAL;
using Api.Model;
using System.Runtime.Remoting.Messaging;

namespace Api.BLL
{
    public class ErrorCodeBLL : BaseBLL<ErrorCode>
    {
        /// <summary>
        ///     子类数据访问类对象
        /// </summary>
        private ErrorCodeDAL childDAL;

        #region 當前類業務類對象

        /// <summary>
        ///     當前類業務類對象
        /// </summary>
        public static ErrorCodeBLL Current
        {
            get
            {
                var name = typeof (ErrorCodeBLL).Name;
                var bll = CallContext.GetData(name) as ErrorCodeBLL;
                if (bll != null)
                {
                    return bll;
                }
                bll = new ErrorCodeBLL();
                CallContext.SetData(name, bll);
                return bll;
            }
        }

        #endregion

        #region 重写父类的抽象方法

        /// <summary>
        ///     重写父类的抽象方法
        /// </summary>
        protected override void SetDAL()
        {
            dal = childDAL = new ErrorCodeDAL();
        }

        #endregion
    }
}